package com.tedu.springdemo.day04;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * 初始化与销毁
 */
@Component
public class UserDao {
@PostConstruct
    public void myInit(){
        System.out.println("初始化链接...");
    }
    public void addUser(){
        System.out.println("增加用户...");
    }
    public void updateUser(){
        System.out.println("修改用户...");
    }
    @PreDestroy
    public void myDestroy(){
        System.out.println("销毁数据库...");
    }
}